package com.fly.db.starter.config

import org.springframework.beans.factory.annotation.Autowired
import org.springframework.context.annotation.Bean
import org.springframework.data.r2dbc.core.DatabaseClient
import org.springframework.data.r2dbc.core.R2dbcEntityTemplate
import org.springframework.data.r2dbc.repository.config.EnableR2dbcRepositories

/**
 * @author  fly
 * @date  2021/5/21 10:43
 * @version 1.0
 */
@EnableR2dbcRepositories
open class AppConfiguration(@Autowired val databaseClient: DatabaseClient){

    @Bean
    fun databaseTemplate () = R2dbcEntityTemplate(databaseClient)
}